package com.pig4cloud.pig.demo.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pig.demo.feign.Entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User>{
    @Select("SELECT * FROM user WHERE is_deleted = 0 and is_banned = 0 and username=#{username} and password=#{password}")
    public User login(@Param("username") String username, @Param("password") String password);

    @Select("SELECT * FROM user WHERE is_deleted = 0 and is_banned = 0 and id=#{id}")
    public User findById(Long id);

    @Select("SELECT id FROM user ")
    public List<Long> getIdList();
}
